package com.example.config;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class MQ {

    @Bean
    public Exchange exchange(){
        return new TopicExchange("canal_exchange",false,true,null);
    }
    @Bean
    public Queue queue(){
        return new Queue("canal_queue",false,false,true,null);
    }
    @Bean
    public Binding binding(){
        return BindingBuilder.bind(queue()).to(exchange()).with("canal_key").noargs();
    }
}
